<template>
  <div class="component">
      <div class="word-container"><span>获得结局</span></div>
      <div class="data-container">
        {{ content.value?.imageName || "暂无图片.png" }}
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, PropType, watch, ref } from "vue";
export default defineComponent({
  name: "Ending",
  props: {
    id: {
      type: String as PropType<string>,
      default: "0000"
    },
    valueFromParent: {
      type: Object as PropType<Object>,
      required: true,
      default: {}
    }
  },
  setup(props) {
    const content = ref(props.valueFromParent.moduleValue);
    watch(
      () => props.valueFromParent,
      newVal => {
        content.value = newVal.moduleValue;
      },
      { deep: true }
    );
    return {
      content
    };
  }
});
</script>

<style scoped>
.word-container {
  margin-left: 20px; /* 解锁章节距离左边10px */
  margin-top: 9px; /* 解锁章节距离上面8px */
  width: 100px;
}
.data-container {
  margin-left: 20px; /* 解锁章节距离左边10px */
  margin-top: 9px; /* 解锁章节距离上面8px */
}

.component {
  display: flex;
  span {
    left: 61.17px;
    top: 1970.34px;
    width: 65px;
    height: 25px;
    opacity: 1;
    /** 文本1 */
    font-size: 16.18px;
    font-weight: 400;
    letter-spacing: 0px;
    line-height: 24.27px;
    color: rgba(145, 145, 145, 1);
    text-align: left;
    vertical-align: top;
    margin-left: 20px; /* 解锁章节距离左边10px */
    margin-top: 18px; /* 解锁章节距离上面8px */
  }
  /* 样式 */
  color: white;
  border: 1px solid #ff8d1a;
  width: 345px;
  min-height: 40px;
  margin-top: 10px;
  background-color: #232323;
  border-radius: 10px;
  overflow: hidden;
  .video_container {
    padding-top: 20px;
    padding-bottom: 20px;
    padding-left: 108px;
    img {
      border-radius: 10px;
      width: 7.99px;
      height: 9.08px;
    }
  }
}
</style>
